<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>书店</title>
  <link rel="stylesheet" href="shop.css">
  <script src="data.js"></script>
  <script src="bookPress.js"></script>
  <script src="shop.js"></script>
</head>
<body>
<div id="mainDiv">
  <div class="bookDiv" style="display: flex">
    <div style="width: 200px;">
    <span id="idSpan" style="display:none;"></span>
    <p>图书名:<span id="bookNameSpan"></span></p>
    <p>作者:<span id="autoSpan"></span></p>
    <p>售价:<span id="priceSpan"></span></p>
      <input type="button" value="放入购物车" onclick="buy($('idSpan').innerHTML)">
    </div>
    <img src="" id="bookImg" width="200px" height="200px">
  </div>
  <div class="bookDiv">
    <table width="100%" cellspacing="0" border="1">
      <thead>
      <tr><th>书名</th><th>作者</th><th>售价</th></tr>
      </thead>
      <tbody id="bookData"></tbody>
    </table>

    图书名:<input type="text" id="searchName">
    <input type="button" value="搜索" onclick="searchBook()">
  </div>
</div>
<div id="shopDiv">
  <div id="shopContentDiv">
    <table border="1" cellspacing="0" width="100%">
      <thead><th>商品名</th><th>单价</th><th>数量</th><th>单项总价</th><th>移除商品</th></thead>
    <tbody id="shopData"></tbody>
    </table>
    <input type="button" value="继续购物" onclick="$('shopDiv').style.visibility = 'hidden'">
    <p>总价:￥<span id="sumSpan"></span></p>
  </div>
</div>
</body>
</html>
